//
//  UIColor+LYString.h
//  99fenqi
//
//  Created by 吴浪 on 16/5/12.
//  Copyright © 2016年 dingli. All rights reserved.
//

#import <UIKit/UIKit.h>

//RGB颜色
#define LYRGBColor(r, g, b, a) [UIColor colorWithRed:(r) / 255.0 \
                                               green:(g) / 255.0 \
                                                blue:(b) / 255.0 \
                                               alpha:(a) * 1.0]
//随机数
#define LYRandomNumber(n) arc4random_uniform(n)
//随机颜色
#define LYRandomColor MYRGBColor(MYRandomNumber(256), \
                                 MYRandomNumber(256), \
                                 MYRandomNumber(256), 1)



NS_ASSUME_NONNULL_BEGIN
@interface UIColor (LYString)
/** 将16进制颜色值如#000000转换成UIColor */
+ (UIColor *)colorWithHexString:(NSString *)hex;
+ (UIColor *)colorWithHexString:(NSString *)hex alpha:(CGFloat)alpha;
@end
NS_ASSUME_NONNULL_END
